home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2196 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.1 KB

  1. Path: scet.org.uk!user
  2. From: Internet@scet.org.uk (Internet)
  3. Newsgroups: comp.lang.c
  4. Subject: None
  5. Date: Fri, 19 Jan 96 17:53:14 -0000
  6. Organization: SCET
  7. Message-ID: <-1390048502.ensmtp@scet.org.uk>
  8. NNTP-Posting-Host: 193.123.133.24
  9. X-Newsreader: ExpressNet/SMTP v1.1.5
  10.  
  11. From: schlein@umbc.edu (Jonas J. Schlein)
  12. Newsgroups: comp.lang.c
  13. Subject: Re: What the hell is THIS?!
  14. Date: 13 Jan 1996 00:33:18 -0500
  15. Organization: University of Maryland Baltimore County
  16. Lines: 32
  17. Message-ID: <4d7g6u$j0l@umbc9.umbc.edu>
  18. References: <4d6rgh$rfu@abel.cc.sunysb.edu>
  19. NNTP-Posting-Host: f-umbc9.umbc.edu
  20. NNTP-Posting-User: schlein
  21.  
  22. Bommasamudram Madhusudan <bmadhusu@engws12.ic.sunysb.edu> wrote:
  23. |> hi guys;
  24. |> 
  25. |> I'm going nuts trying to figure this out;
  26. |> 
  27. |> Can someone explain what
  28. |> 
  29. |>   int (*p)[3]  is?????
  30. |> 
  31. |>   Is this an array of pointers to integers 
  32. |> 
  33. |>   OR
  34. |> 
  35. |>   a pointer to an array of integers?? HELP!
  36.  
  37. According to cdecl:
  38.  
  39. cdecl> explain int (*p)[3]
  40. declare p as pointer to array 3 of int
  41.  
  42. |> I can say things like:
  43. |> 
  44. |> (*p)[0] = 3; for e.g, but when I print the value using:
  45. |> 
  46. |>  printf("%d",(*p)[0]) I get a core dump!
  47.  
  48. Exactly...Because it is a pointer, you need to associate some space
  49. with it via malloc() or the like.
  50. -- 
  51. "If it wasn't for C, we would be using BASI, PASAL, and OBOL."
  52.  
  53. Jonas J. Schlein  (schlein@gl.umbc.edu)
  54.  
  55.  
  56. -=-=-=-=-=-=-=-=-=-=-=-=-=-= RFC850 Headers Follow
  57. =-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58. X-ENSMTPGroup: comp.lang.c
  59. 220 93573 <4d7g6u$j0l@umbc9.umbc.edu> article
  60. Path:
  61. uknet!uknet!peer-news.britain.eu.net!EU.net!newsfeed.internetmci.com!howland.re
  62. ston.ans.net!math.ohio-state.edu!pacific.mps.ohio-state.edu!freenet.columbus.oh
  63. us!magnus.acs.ohio-state.edu!lerc.nasa.gov!purdue!haven.umd.edu!news.umbc.edu!
  64. not-for-mail
  65.  
  66.  
  67. --
  68.  
  69.      _/_/_/  _/_/_/  _/_/_/  _/_/_/  | Tel: (0141) 337 5000  
  70.     _/      _/      _/        _/     | Fax: (0141) 337 5050  
  71.    _/_/_/  _/      _/_/      _/      | Net: scet@scet.org.uk 
  72.       _/  _/      _/        _/       | AppleLink: SCET.DEV   
  73.  _/_/_/  _/_/_/  _/_/_/    _/        |                       
  74. ......learning through technology   |
  75.